using System;
using System.Collections;

namespace Sedna.Core.Controller.Configurations
{
	/// <summary>
	/// Enter configuration implementation.
	/// </summary>
	public class EnterConfiguration: ClientScriptingConfiguration, IEnterConfiguration
	{
		private string enterType;
		private IDictionary parameterControls;
		private IDictionary displayControls;
		private int maxLength;
		private bool hookupParameterControlsEvents=true;
		private bool showUnnamed=false;
		private bool showInactive=true;

        private IPopupButtonConfiguration popupButtonConfiguration;
        
	    private String allowManualEnterUnbindPath;
        private String allowManualEnterBindPath;
	    private bool allowManualEnter = true;

	    public bool AllowManualEnter
	    {
	        get { return allowManualEnter; }
            set { allowManualEnter = value; }
	    }

        public String AllowManualEnterBindPath
	    {
	        get { return allowManualEnterBindPath; }
            set { allowManualEnterBindPath = value; }
	    }

        public String AllowManualEnterUnbindPath
	    {
	        get { return allowManualEnterUnbindPath; }
            set { allowManualEnterUnbindPath = value; }
	    }

        public String AllowManualEnterPath
        {
            set
            {
                allowManualEnterBindPath = value;
                allowManualEnterUnbindPath = value;
            }
        }

	    public IPopupButtonConfiguration PopupButtonConfiguration
	    {
	        get { return popupButtonConfiguration; }
	        set { popupButtonConfiguration = value; }
	    }


	    public bool HookupParameterControlsEvents
		{
			get { return hookupParameterControlsEvents; }
			set { hookupParameterControlsEvents = value; }
		}

		public string EnterType
		{
			get { return enterType; }
			set { enterType = value; }
		}

		public IDictionary ParameterControls
		{
			get { return parameterControls; }
			set { parameterControls = value; }
		}

		public IDictionary DisplayControls
		{
			get { return displayControls; }
			set { displayControls = value; }
		}

		public int MaxLength
		{
			get { return maxLength; }
			set { maxLength = value; }
		}

		public bool ShowUnnamed
		{
			get { return showUnnamed; }
			set { showUnnamed = value; }
		}

		public bool ShowInactive
		{
			get { return showInactive; }
			set { showInactive = value; }
		}

	    public override IConfiguration CreateFromTemplate()
	    {
            EnterConfiguration that = (EnterConfiguration)base.CreateFromTemplate();
            that.enterType = enterType;
            that.parameterControls = parameterControls;
            that.displayControls = displayControls;
            that.maxLength = maxLength;
            that.hookupParameterControlsEvents = hookupParameterControlsEvents;
            that.showUnnamed = showUnnamed;
            that.showInactive = showInactive;
            that.popupButtonConfiguration = popupButtonConfiguration;
	        return that;
	    }
	}
}
